package com.cloud.dynamic.gateway.service;

import org.springframework.cloud.gateway.route.RouteDefinition;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import reactor.core.publisher.Flux;

public abstract class GatewayRuleService implements ApplicationEventPublisherAware {

    protected ApplicationEventPublisher applicationEventPublisher;

    public abstract void add(RouteDefinition routeDefinition);

    public abstract Flux<RouteDefinition> list();

    public abstract void remove(String dataId);

    @Override
    public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
        this.applicationEventPublisher = applicationEventPublisher;
    }
}
